﻿using System;

namespace NMapper
{
    public class MapperFactory<TDatabase> 
        where TDatabase : IDisposable
    {
        public MappingContext<TDatabase> Context { get; set; }

        public MapperFactory(MappingContext<TDatabase> context)
        {
            Context = context;
        }

        public Mapper<TDatabase, TSubDatabaseEntity, TSubOutput> Create<TSubDatabaseEntity, TSubOutput>()
            where TSubOutput : class
        {
            var strategy = new Mapper<TDatabase, TSubDatabaseEntity, TSubOutput>(Context);
            return strategy;
        }
    }
}